package com.yinuo.repository;

import com.yinuo.entity.LinuxShellCmd;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Created by gt.ao on 2018/8/17.
 */
public interface LinuxRepository extends JpaRepository<LinuxShellCmd,String>{

    //查询全部linux shell
    List<LinuxShellCmd> findAll();

    //查询用户名称包含username字符串的用户对象
    List<LinuxShellCmd> findByCmdContaining(String name);

    //根据key查询
    LinuxShellCmd findByKey(String key);

    //复杂查询
    Page<LinuxShellCmd> findAll(Specification<LinuxShellCmd> spec, Pageable pageable);

    //通过key删除
    Integer deleteLinuxShellCmdByKey(String key);

}
